package api

import (
	"gfrest/common/base"
	"gfrest/common/util"

	"github.com/gogf/gf/frame/g"

	"github.com/gogf/gf/net/ghttp"
)

// MiscController MiscController
type MiscController struct {
}

// Index Index
func (p *MiscController) Index(r *ghttp.Request) {

	r.Response.WriteJson(g.Map{"msg": "ok"})
}

// Captcha Captcha
// @Summary 获取验证码图片信息
// @Description 获取验证码图片信息
// @Tags misc
// @success 200 {object} base.Result{} "desc"
// @Router /misc/captcha [get]
// @Security
func (p *MiscController) Captcha(r *ghttp.Request) {
	idKeyC, base64stringC := util.GetVerifyImgString()
	base.Success(r, g.MapStrStr{"idKeyC": idKeyC, "base64stringC": base64stringC})
}
